package net.csdn.business.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;


/**
 * @Desc: 操作日志动作枚举
 * @ClassName: ActionTypeEnum
 * @Author: zhangyl
 * @Date: 2022/8/3 10:36
 */
@Getter
public enum SourceTypeEnum{
    ORG(1, "组织"),
    PROJECT(2, "仓库"),
    ;

    @EnumValue
    private Integer value;
    @JsonValue
    private String desc;

    SourceTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String get(Integer value) {
        for (SourceTypeEnum action : SourceTypeEnum.values()) {
            if (action.value.equals(value)) {
                return action.getDesc();
            }
        }
        throw new IllegalArgumentException("value param error");
    }


}
